<div ng-include="sys_html('layout/_header')"></div>
<style>
.modal-open {
	overflow:hidden
}
.modal {
	position:fixed;
	top:0;
	right:0;
	bottom:0;
	left:0;
	z-index:1050;
	display:none;
	overflow:hidden;
	-webkit-overflow-scrolling:touch;
	outline:0
}
.modal.fade .modal-dialog {
	-webkit-transition:-webkit-transform .3s ease-out;
	-o-transition:-o-transform .3s ease-out;
	transition:transform .3s ease-out;
	-webkit-transform:translate(0,-25%);
	-ms-transform:translate(0,-25%);
	-o-transform:translate(0,-25%);
	transform:translate(0,-25%)
}
.modal.in .modal-dialog {
	-webkit-transform:translate(0,0);
	-ms-transform:translate(0,0);
	-o-transform:translate(0,0);
	transform:translate(0,0)
}
.modal-open .modal {
	overflow-x:hidden;
	overflow-y:auto
}
.modal-dialog {
	position:relative;
	width:auto;
	margin:10px
}
.modal-content {
	position:relative;
	background-color:#fff;
	-webkit-background-clip:padding-box;
	background-clip:padding-box;
	border:1px solid #999;
	border:1px solid rgba(0,0,0,.2);
	border-radius:6px;
	outline:0;
	-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);
	box-shadow:0 3px 9px rgba(0,0,0,.5)
}
.modal-backdrop {
	position:fixed;
	top:0;
	right:0;
	bottom:0;
	left:0;
	z-index:1040;
	background-color:#000
}
.modal-backdrop.fade {
	filter:alpha(opacity=0);
	opacity:0
}
.modal-backdrop.in {
	filter:alpha(opacity=50);
	opacity:.5
}
.modal-header {
	padding:15px;
	border-bottom:1px solid #e5e5e5
}
.modal-header .close {
	margin-top:-2px
}
.modal-title {
	margin:0;
	line-height:1.42857143
}
.modal-body {
	position:relative;
	padding:15px
}
.modal-footer {
	padding:15px;
	text-align:right;
	border-top:1px solid #e5e5e5
}
.modal-footer .btn+.btn {
	margin-bottom:0;
	margin-left:5px
}
.modal-footer .btn-group .btn+.btn {
	margin-left:-1px
}
.modal-footer .btn-block+.btn-block {
	margin-left:0
}
.modal-scrollbar-measure {
	position:absolute;
	top:-9999px;
	width:50px;
	height:50px;
	overflow:scroll
}
@media (min-width:768px) {
	.modal-dialog {
	width:600px;
	margin:30px auto
}
.modal-content {
	-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);
	box-shadow:0 5px 15px rgba(0,0,0,.5)
}
.modal-sm {
	width:300px
}
}@media (min-width:992px) {
	.modal-lg {
	width:900px
}
}
</style>
<div class="ncm-container">    	<div ng-include="sys_html('layout/member/left-layout')"></div>
    <link rel="stylesheet" type="text/css" href="../addons/jy_weishop/resource/pc/css/dcalendar.picker.css"  />    <div class="right-layout">        <link href="../addons/jy_weishop/resource/pc/css/font-awesome.min.css" rel="stylesheet" />        <div class="wrap">			<div ng-include="sys_html('layout/member/tabmenu')"></div>
            <form method="GET">                <table class="ncm-search-table">                    <input ng-if="pagedata.mk=='recycle'" type="hidden" name="mk" value="recycle">                    <tbody>                    <tr>                        <td>&nbsp;</td>                        <th>订单状态</th>                        <td class="w100">
							<select name="status" ng-model="pagedata.status">                                <option value="100" ng-selected="pagedata.status==100">所有订单</option>                                      <option value="0" ng-selected="pagedata.status==0">                                    待付款                                </option>								<option value="1" ng-selected="pagedata.status==1">                                    待发货                                </option>								<option value="2" ng-selected="pagedata.status==2">                                    待收货                                </option>								<option value="3" ng-selected="pagedata.status==3">                                    已完成                                </option>								<option value="4" ng-selected="pagedata.status==4">                                    退/换货                                </option>								<option value="-1" ng-selected="pagedata.status==-1">                                    已取消                                </option>                            </select>
							</td>                        <th>订单号</th>                        <td class="w160"><input type="text" ng-model="pagedata.ordersn"  class="text w150" name="order_sn"></td>                        <td class="w70 tc">                            <label class="submit-border">                                <input type="submit" class="submit" href="javascript:;" ng-click="tool.get_list('jy_weishop/order.list/getlist/status='+pagedata.status+'&ordersn='+pagedata.ordersn,true);" value="搜索">                            </label>                        </td>                    </tr>                    </tbody>                </table>            </form>            <div class="fui-page">                <div class='order-list-page'>                    <div class='fui-content navbar order-list' style="background-color: #fff">                       
                        <div ng-if="!pagedata.list || pagedata.list.length<1" class='fui-content-inner' >                            <div class='content-empty' >                                <i class='icon icon-lights'></i><br/>暂时没有任何订单<br/><a href="javascript:;" ng-click="access_json('jy_weishop/index/')" class='btn btn-default-o external'>到处逛逛</a>                            </div>                            <div class='container'></div>                        </div>
                                <div ng-if="pagedata.list.length>0" ng-repeat="order in pagedata.list" class='order-item'>                                                                      <a href="javascript:;" ng-click="access_json('jy_weishop/order.detail//id='+order.id)" data-nocache='true'>                                        <div ng-repeat="m in order.merchs">                                           <a ng-if="m.id" href="javascript:;" data-nocache="true" ng-click="access_json('jy_weishop/merch//id='+m.id)">
												<div class="fui-list-group-title bold">
													<i class="icon jinyunicon icon-dianpu"></i> {{m.merchname || '多商户'}}
													<span class="status noremark" style="font-size:0.50rem" >订单号: {{order.ordersn}}</span>
												</div>
											</a>
											<a ng-if="!m.id" href="javascript:;" data-nocache="true" ng-click="access_json('jy_weishop/index/')">
												<div class="fui-list-group-title bold">
													<i class="icon jinyunicon icon-dianpu"></i> {{pagedata.shopset.store_title || '平台自营'}}
													<span class="status noremark" style="font-size:0.50rem" >订单号: {{order.ordersn}}</span>
												</div>
											</a>
											<a href="javascript:;" ng-repeat="g in m.goods" class="fui-list-group external" data-nocache="true" ng-click="access_json('jy_weishop/order.detail//id='+order.id)">
												<div class="fui-list goods-list">
													<div class="fui-list-media" style="">
														<img class="" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}">
													</div>
													<div class="fui-list-inner">
														<div class="text goodstitle towline">{{g.title}}</div>
														<div class="text" style="color:#f60;font-size:0.50rem">{{g.selespename || '无规格'}} x {{g.total || 1}}</div>
														<div ng-if="order.buytypetitle" class="text"><i class="fui-tag fui-tag-red">{{order.buytypetitle || ''}}</i></div>
													</div>
													<div class="fui-list-angle" style="width:3rem">
														￥<span class="marketprice">{{g.price}}</span>
														<span class='status {{order.statuscss}}'>{{order.statustitle}}</span>
													</div>
														
												</div>
											</a>                                                                                    </div>                                     
                                     <!--   <div ng-repeat="g in order.goods" class="fui-list goods-list">                                            <div class="fui-list-media">                                                <img ng-src="{{tomedia(g.image)}}" class="round">                                            </div>                                            <div class="fui-list-inner">                                                <div class="text goodstitle">{{g.title}}</div>                                                <div ng-if="g.optionid != 0" class='subtitle'>{{g.optiontitle}}</div>                                            </div>                                            <div class='fui-list-angle'>                                                ￥<span class='marketprice'>{{g.price}}<br/>   x{{g.total}}                                            </div>                                        </div>										-->                                        <div class='fui-list-group-title'>                                            <span class='status'>共 <span class='text-danger'>{{order.goods.total || 1}}</span> 个商品 实付: <span class='text-danger'>￥{{order.price}}</span></span>                                        </div>
										<div class="fui-list-group" style="text-align: right;padding:10px">
													<div ng-show="order.userdeleted!=1 && order.status==0" ng-click="post({'id':order.id},'cancel')" class="btn btn-sm btn-default-o order-cancel">取消订单</div>
													<a ng-show="order.userdeleted!=1 && order.status==0 && order.paytype!=3 && !pagedata.ispeerpay" class="btn btn-sm btn-red-o"  ng-click="pagedata.pay_submit({},'jy_weishop/order.list/pay/id='+order.id)">支付订单</a>
													<a ng-show="(order.userdeleted!=1 && order.status==0) && (order.paytype==3 || pagedata.ispeerpay)" class="btn btn-sm btn-red-o"  ng-click="pagedata.pay_submit({},'jy_weishop/order.list/pay/id='+order.id)">代付订单</a>	
													<div ng-show="order.status==3 || order.status==-1" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({'id':order.id},'cancel')">删除订单</div>
												<!--	<a ng-show="order.status==3 || order.iscomment==1" class="btn btn-sm btn-default-o" href="javascript:" ng-click="access_json('jy_weishop/order.comment/comment/id='+order.id)">追加评价</a> -->
														<a ng-show="!pagedata.activity && !order.refundstate && order.status>0 && order.isshare == 0" data-nocache="true" class="btn btn-sm btn-default-o" href="javascript:" ng-click="access('jy_weishop/coupon.index/')">领取优惠券</a>
													<div  ng-show="order.sendtype==1 && order.status==2 && !order.refundstate" class="btn btn-sm btn-default-o order-finish" href="javascript:" ng-click="post({'id':order.id},'receive')">确认收货</div>
													<a ng-show="order.status==5"  class="btn btn-sm btn-default-o" href="javascript:" ng-click="access_json('jy_weishop/order.refund/list/orderid='+order.id)">查看退款进度</a>
													<a ng-show="order.can_refund"  class="btn btn-sm btn-default-o" href="javascript:" ng-click="access_json('jy_weishop/order.refund/apply/orderid='+order.id)" >申请退款</a>
													<!--<a ng-show="order.canrefund && order.status!=1" data-nocache="true" class="btn btn-sm btn-default-o" href="javascript:" ng-click="access_json('jy_weishop/order.refund//id='+order.id)" >申请售后</a>-->
													<a ng-show="order.refundstate > 0 && pagedata.refund.status!=5" class='btn btn-sm btn-default-o btn-cancel'>取消申请</a>
												<div ng-show="order.userdeleted==1" class="btn btn-sm btn-default-o order-deleted" href="javascript:" ng-click="post({},'jy_weishop/order.detail/rdelete/','id='+order.id)">彻底删除订单</div>
												<div ng-show="order.userdeleted==1" class="btn btn-sm btn-default-o order-recover" href="javascript:" ng-click="post({},'jy_weishop/order.detail/reset/','id='+order.id)">恢复订单</div>
												<a class='btn btn-sm btn-default-o btn-cancel' href="javascript:" ng-click="access_json('jy_weishop/order.detail//id='+order.id)">订单详情>></a>
											
										</div>                                    </a>                                    <div class='fui-list-group-title opblock' style="height: auto;">                                        <span class='status'>                                       
                                            <div ng-if="order.userdeleted==1 && (order.status==3 || order.status==-1)" class="btn btn-default btn-default-o order-deleted" ng-click="post({},'jy_weishop/order.detail/rdelete/','id='+order.id)">彻底删除订单</div>                                                                                     <div ng-if="order.userdeleted==1 && order.status==3"  class="btn btn-default btn-default-o order-recover" ng-click="post({},'jy_weishop/order.detail/reset/','id='+order.id)">恢复订单</div>                                                                                 
                                            <div ng-if="order.userdeleted==0 && order.status==0" class="btn btn-default btn-default-o order-cancel">取消订单                                                <select data-orderid="{$order['id']}">                                                    <option value="">不取消了</option>                                                    <option value="我不想买了">我不想买了</option>                                                    <option value="信息填写错误，重新拍">信息填写错误，重新拍</option>                                                    <option value="同城见面交易">同城见面交易</option>                                                    <option value="其他原因">其他原因</option>                                                </select>                                            </div>                                                                                    <a ng-if="order.userdeleted==0 && order.paytype!=3" class="btn btn-danger" href="javascript:" ng-click="post({},'pay','id='+order.id)" data-nocache="true" >支付订单</a>                                                                                                                                                                         <div ng-if="order.userdeleted==0 && order.canverify && order.status!=-1 && order.status!=0" class="btn btn-default btn-default-o order-verify" data-nocache="true" data-orderid="{$order['id']}" data-verifytype="{$order['verifytype']}" style="margin-left:.5rem;" >                                                <i class="icon icon-qrcode"></i>                                                <span>{{ifelse(order.dispatchtype==1,'我要取货','我要使用')}}</span>                                            </div>                                                                                                                                <div ng-if="order.userdeleted==0 && order.status==3 && order.status==-1"  class="btn btn-default btn-default-o order-delete" href="javascript:" ng-click="post({},'del','id='+order.id)">删除订单</div>                                                               <!--          {if empty($trade['closecomment'])}                                                {if $order['status']==3 && $order['iscomment']==1}                                                <a class="btn btn-default btn-default-o" data-nocache="true" href="{php echo mobileUrl('pc.order/comment')}&id={$order['id']}">追加评价</a>                                                {/if}                                                {if $order['status']==3 && $order['iscomment']==0}                                                <a class="btn btn-default btn-default-o" data-nocache="true" href="{php echo mobileUrl('pc.order/comment')}&id={$order['id']}">评价</a>                                                {/if}                                            {/if}-->                                                                                        <div ng-if="order.userdeleted==0 && order.status==2" class="btn btn-default btn-default-o order-finish" href="javascript:" ng-click="post({},'receive','id='+order.id)">确认收货</div>                                                                                                                                   <a ng-if="order.userdeleted==0 && order.canrefund" class="btn btn-warning" data-nocache="true" href="{php echo mobileUrl('pc.order/refund')}&id={$order['id']}">{{ifelse(order.status==1,'申请退款','申请售后')}}{{ifelse(order.refundstate>0,'中','')}}</a>                                                                                 </span>                                    </div>                                </div>                   
                   						<div ng-include="sys_html('_copyright')"></div>                    </div>         					<div ng-if="pagedata.verify" ng-include="sys_html('order/verify')"></div>            
                </div>            </div>            {{pagedata.pager}}        </div>     </div></div><div ng-include="sys_html('layout/_footer')"></div>
<script>
scope.tool.get_list('jy_weishop/order.list/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/order.list/getlist/status='+scope.pagedata.status);
}
scope.pagedata.pay_submit=function(post,post_url){
	scope.post_json(post_url,post,function(pay_id){
		require(['jinyun_socket'],function(jinyun_socket){
					jinyun_socket.connect();
					jinyun_socket.onsystem=function(res){
						$('#core-pay-modal').modal('hide');
						scope.message('支付成功！','success','jy_weishop/order.list//fromcreate=1');
					}
		});
		scope.tool.pay(pay_id,function(res){
		},'',scope.pagedata.forward_url);
	});
}
</script>